{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nvar _excluded = [\"component\", \"children\", \"onVisibleChanged\", \"onAllRemoved\"],\n  _excluded2 = [\"status\"];\n\n/* eslint react/prop-types: 0 */\nimport * as React from 'react';\nimport OriginCSSMotion from './CSSMotion';\nimport { supportTransition } from './util/motion';\nimport { STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED, diffKeys, parseKeys } from './util/diff';\nvar MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];\n/**\n * Generate a CSSMotionList component with config\n * @param transitionSupport No need since CSSMotionList no longer depends on transition support\n * @param CSSMotion CSSMotion component\n */\n\nexport function genCSSMotionList(transitionSupport) {\n  var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OriginCSSMotion;\n  var CSSMotionList = /*#__PURE__*/function (_React$Component) {\n    _inherits(CSSMotionList, _React$Component);\n    var _super = _createSuper(CSSMotionList);\n    function CSSMotionList() {\n      var _this;\n      _classCallCheck(this, CSSMotionList);\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n      _this = _super.call.apply(_super, [this].concat(args));\n      _this.state = {\n        keyEntities: []\n      };\n      _this.removeKey = function (removeKey) {\n        var keyEntities = _this.state.keyEntities;\n        var nextKeyEntities = keyEntities.map(function (entity) {\n          if (entity.key !== removeKey) return entity;\n          return _objectSpread(_objectSpread({}, entity), {}, {\n            status: STATUS_REMOVED\n          });\n        });\n        _this.setState({\n          keyEntities: nextKeyEntities\n        });\n        return nextKeyEntities.filter(function (_ref) {\n          var status = _ref.status;\n          return status !== STATUS_REMOVED;\n        }).length;\n      };\n      return _this;\n    }\n    _createClass(CSSMotionList, [{\n      key: \"render\",\n      value: function render() {\n        var _this2 = this;\n        var keyEntities = this.state.keyEntities;\n        var _this$props = this.props,\n          component = _this$props.component,\n          children = _this$props.children,\n          _onVisibleChanged = _this$props.onVisibleChanged,\n          onAllRemoved = _this$props.onAllRemoved,\n          restProps = _objectWithoutProperties(_this$props, _excluded);\n        var Component = component || React.Fragment;\n        var motionProps = {};\n        MOTION_PROP_NAMES.forEach(function (prop) {\n          motionProps[prop] = restProps[prop];\n          delete restProps[prop];\n        });\n        delete restProps.keys;\n        return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2) {\n          var status = _ref2.status,\n            eventProps = _objectWithoutProperties(_ref2, _excluded2);\n          var visible = status === STATUS_ADD || status === STATUS_KEEP;\n          return /*#__PURE__*/React.createElement(CSSMotion, _extends({}, motionProps, {\n            key: eventProps.key,\n            visible: visible,\n            eventProps: eventProps,\n            onVisibleChanged: function onVisibleChanged(changedVisible) {\n              _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {\n                key: eventProps.key\n              });\n              if (!changedVisible) {\n                var restKeysCount = _this2.removeKey(eventProps.key);\n                if (restKeysCount === 0 && onAllRemoved) {\n                  onAllRemoved();\n                }\n              }\n            }\n          }), children);\n        }));\n      }\n    }], [{\n      key: \"getDerivedStateFromProps\",\n      value: function getDerivedStateFromProps(_ref3, _ref4) {\n        var keys = _ref3.keys;\n        var keyEntities = _ref4.keyEntities;\n        var parsedKeyObjects = parseKeys(keys);\n        var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);\n        return {\n          keyEntities: mixedKeyEntities.filter(function (entity) {\n            var prevEntity = keyEntities.find(function (_ref5) {\n              var key = _ref5.key;\n              return entity.key === key;\n            }); // Remove if already mark as removed\n\n            if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {\n              return false;\n            }\n            return true;\n          })\n        };\n      } // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.\n    }]);\n\n    return CSSMotionList;\n  }(React.Component);\n  CSSMotionList.defaultProps = {\n    component: 'div'\n  };\n  return CSSMotionList;\n}\nexport default genCSSMotionList(supportTransition);","map":{"version":3,"names":["_extends","_objectWithoutProperties","_objectSpread","_classCallCheck","_createClass","_inherits","_createSuper","_excluded","_excluded2","React","OriginCSSMotion","supportTransition","STATUS_ADD","STATUS_KEEP","STATUS_REMOVE","STATUS_REMOVED","diffKeys","parseKeys","MOTION_PROP_NAMES","genCSSMotionList","transitionSupport","CSSMotion","arguments","length","undefined","CSSMotionList","_React$Component","_super","_this","_len","args","Array","_key","call","apply","concat","state","keyEntities","removeKey","nextKeyEntities","map","entity","key","status","setState","filter","_ref","value","render","_this2","_this$props","props","component","children","_onVisibleChanged","onVisibleChanged","onAllRemoved","restProps","Component","Fragment","motionProps","forEach","prop","keys","createElement","_ref2","eventProps","visible","changedVisible","restKeysCount","getDerivedStateFromProps","_ref3","_ref4","parsedKeyObjects","mixedKeyEntities","prevEntity","find","_ref5","defaultProps"],"sources":["/data/messenger.client/node_modules/rc-motion/es/CSSMotionList.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nvar _excluded = [\"component\", \"children\", \"onVisibleChanged\", \"onAllRemoved\"],\n    _excluded2 = [\"status\"];\n\n/* eslint react/prop-types: 0 */\nimport * as React from 'react';\nimport OriginCSSMotion from './CSSMotion';\nimport { supportTransition } from './util/motion';\nimport { STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED, diffKeys, parseKeys } from './util/diff';\nvar MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd'];\n/**\n * Generate a CSSMotionList component with config\n * @param transitionSupport No need since CSSMotionList no longer depends on transition support\n * @param CSSMotion CSSMotion component\n */\n\nexport function genCSSMotionList(transitionSupport) {\n  var CSSMotion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OriginCSSMotion;\n\n  var CSSMotionList = /*#__PURE__*/function (_React$Component) {\n    _inherits(CSSMotionList, _React$Component);\n\n    var _super = _createSuper(CSSMotionList);\n\n    function CSSMotionList() {\n      var _this;\n\n      _classCallCheck(this, CSSMotionList);\n\n      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      _this = _super.call.apply(_super, [this].concat(args));\n      _this.state = {\n        keyEntities: []\n      };\n\n      _this.removeKey = function (removeKey) {\n        var keyEntities = _this.state.keyEntities;\n        var nextKeyEntities = keyEntities.map(function (entity) {\n          if (entity.key !== removeKey) return entity;\n          return _objectSpread(_objectSpread({}, entity), {}, {\n            status: STATUS_REMOVED\n          });\n        });\n\n        _this.setState({\n          keyEntities: nextKeyEntities\n        });\n\n        return nextKeyEntities.filter(function (_ref) {\n          var status = _ref.status;\n          return status !== STATUS_REMOVED;\n        }).length;\n      };\n\n      return _this;\n    }\n\n    _createClass(CSSMotionList, [{\n      key: \"render\",\n      value: function render() {\n        var _this2 = this;\n\n        var keyEntities = this.state.keyEntities;\n\n        var _this$props = this.props,\n            component = _this$props.component,\n            children = _this$props.children,\n            _onVisibleChanged = _this$props.onVisibleChanged,\n            onAllRemoved = _this$props.onAllRemoved,\n            restProps = _objectWithoutProperties(_this$props, _excluded);\n\n        var Component = component || React.Fragment;\n        var motionProps = {};\n        MOTION_PROP_NAMES.forEach(function (prop) {\n          motionProps[prop] = restProps[prop];\n          delete restProps[prop];\n        });\n        delete restProps.keys;\n        return /*#__PURE__*/React.createElement(Component, restProps, keyEntities.map(function (_ref2) {\n          var status = _ref2.status,\n              eventProps = _objectWithoutProperties(_ref2, _excluded2);\n\n          var visible = status === STATUS_ADD || status === STATUS_KEEP;\n          return /*#__PURE__*/React.createElement(CSSMotion, _extends({}, motionProps, {\n            key: eventProps.key,\n            visible: visible,\n            eventProps: eventProps,\n            onVisibleChanged: function onVisibleChanged(changedVisible) {\n              _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, {\n                key: eventProps.key\n              });\n\n              if (!changedVisible) {\n                var restKeysCount = _this2.removeKey(eventProps.key);\n\n                if (restKeysCount === 0 && onAllRemoved) {\n                  onAllRemoved();\n                }\n              }\n            }\n          }), children);\n        }));\n      }\n    }], [{\n      key: \"getDerivedStateFromProps\",\n      value: function getDerivedStateFromProps(_ref3, _ref4) {\n        var keys = _ref3.keys;\n        var keyEntities = _ref4.keyEntities;\n        var parsedKeyObjects = parseKeys(keys);\n        var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);\n        return {\n          keyEntities: mixedKeyEntities.filter(function (entity) {\n            var prevEntity = keyEntities.find(function (_ref5) {\n              var key = _ref5.key;\n              return entity.key === key;\n            }); // Remove if already mark as removed\n\n            if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {\n              return false;\n            }\n\n            return true;\n          })\n        };\n      } // ZombieJ: Return the count of rest keys. It's safe to refactor if need more info.\n\n    }]);\n\n    return CSSMotionList;\n  }(React.Component);\n\n  CSSMotionList.defaultProps = {\n    component: 'div'\n  };\n  return CSSMotionList;\n}\nexport default genCSSMotionList(supportTransition);"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,SAAS,MAAM,qCAAqC;AAC3D,OAAOC,YAAY,MAAM,wCAAwC;AACjE,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,CAAC;EACzEC,UAAU,GAAG,CAAC,QAAQ,CAAC;;AAE3B;AACA,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,MAAM,aAAa;AACzC,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,UAAU,EAAEC,WAAW,EAAEC,aAAa,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,aAAa;AACzG,IAAIC,iBAAiB,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,CAAC;AACzV;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,gBAAgB,CAACC,iBAAiB,EAAE;EAClD,IAAIC,SAAS,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAKE,SAAS,GAAGF,SAA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